<meta charset="utf-8">
<style>
        .layui-layer-title{
            height: 30px!important;
            line-height: 30px!important;
        }
        .lay-box{
            border: 1px #dfdfdf solid;
            width: 98%;
            /*height: 100%;*/
            margin: 0 auto;
            padding-bottom:35px;
        }
        
        .lay-box .lay-submit{
            background: #01AAED;
            padding: 0.5rem 3rem;
            color: white;
            border-radius: 6px;
            margin-top: 1.2rem;
        }
        ul{list-style:none;padding: 10px;font-size: 12px;}
        li{padding:0;}
        .lileft{width: 130px;text-align:right;height:30px;line-height: 30px;color: #909090;float:left;}
        .liright{height:30px;line-height:30px;vertical-align:middle;}
        .btn{width:100%;text-align:center;}
        .layui-btn{text-align:center;background-color:#369CDA;color:#FFF;height: 35px;margin:0 auto;display:inline-block;width:100px;}
    </style>
    <form action="" method="post" class="ajaxform">
    <div class="lay-box">
    <!-- <div class="lay-content"><span class="lay-span">岗位名：</span>
    <div class="rig"><input type="text" placeholder="管理员" class="lay-input-text"><br>
    <input type="submit" value="提交" class="lay-submit"></div>
    </div>
 -->

    <ul>
        <li>
            <div class="lileft">模板名称</div>
            <div class="liright">
                <span class="textbox" style="width:300px;">
                    <input  type="text"  autocomplete="off"  placeholder="给员工创建账号后，将账号和密码发送到员工手机。" style="margin-left:5px; height: 24px; line-height: 24px; width:305px;" value="{$data.name}" name="name">
                </span>
            </div>
        </li>
        <li>
            <div class="lileft">模板内容</div>
            <div class="liright" style="height:auto;">
                <div >{$data.content}</div>
            </div>
        </li>
        <li>
            <div class="lileft">#code#值为</div>
            <div class="liright" style="height:auto;">
                    <textarea placeholder="短信模板内容" style="width:305px;height:150px;text-indent:10px;line-height:20px;margin-left:5px;" name="explain"> {$data.explain}
                    </textarea>
            </div>
        </li>
        <li >
                <div class="lileft">短信预览：</div>
                <div  class="liright" style="height:auto;">
                    <textarea  style="width:305px;height:150px;text-indent:10px;line-height:20px;margin-top:5px;margin-left:5px;" disabled="disabled">{$data.content} {$data.explain}

                    </textarea>
                </div>
        </li>
        <li >
                <div class="lileft"></div>
                <div class="liright" style="height:auto;">
                    <div id="msg"><span style="color:#c0c0c0">注意：当前短信长度61字。短信长度如超过<span style="color:green；margin:0px 5px;">67</span>字，将按照两条计费。</span></div>
                </div>
        </li>
        <li >
                <!-- <div class="items fl">自动发送：</div>
                <div class="fill-items fl" style="height:32px;line-height:32px;">                    
                    <input type="radio" name="autoSend" style="margin-top:-3px; margin-left:5px;margin-right:5px;" checked="checked" value="1">是
                    <input type="radio" name="autoSend" style="margin-top:-3px; margin-left:5px;margin-right:5px;" value="0">否
                </div> -->
                <div class="lileft">自动发送</div>
                <div class="liright">
                  <input type="radio" id="yes" name="is_auto" value="1" title="是"  {if(!$data['is_auto'] || $data['is_auto']==1)}checked="checked"{/if}><label for="yes">是</label>
                  <input type="radio" id="no" name="is_auto" value="0" title="否"{if($data['is_auto']==0)}checked="checked"{/if}><label for="no">否</label>
                </div>
        </li>
    </ul>
     <input type="hidden" value="{$data['id']}" name="id">
    <div class="btn">
        <button class="layui-btn">更新</button>
    </div>
</div>
</form>
<script src="__resource_path__/libs/jquery/jquery.js"></script>
<script src="__static_path__/js/layer/layer.js"></script>
<script type="text/javascript">
$('.layui-btn').click(function(){
    $('.ajaxform').submit();
})
$('.ajaxform').submit(function(e){
     e.preventDefault();
     var form = $(this).serialize();
     $.post('{:url("edit")}',form,function(data){
           if (data.success==true) {
              layer.msg(data.errorMsg);
              window.parent.location.reload();
           }
     })
})
</script>



